<!--
 * @Description: 
 * @Date: 2024-05-15 15:16:13
 * @LastEditTime: 2024-06-14 10:17:23
-->
<route lang="json5">
{
  style: {
    navigationBarTitleText: '检察官详情',
    navigationBarTextStyle: 'white', //标题栏字体颜色
    navigationBarBackgroundColor: '#0063AF', //标题栏背景色(纯色)
  },
}
</route>
<template>
  <view class="jianCha w-screen h-screen bg-#F4F5F9">
    <view class="px-40rpx py30rpx bg-#fff">
      <wd-steps :active="active" align-center>
        <wd-step title="提交成功" />
        <wd-step title="审核中" />
        <wd-step title="审核结果" />
      </wd-steps>
    </view>
    <view class="p-20rpx box-border">
      <view class="mb-20rpx rounded-20rpx">
        <wd-cell>
          <template #title>
            <view>
              <view class="inline-block mr-10rpx">申请人:</view>
              <view class="inline-block text-#5a5b5d">{{ caseData.name }}</view>
            </view>
          </template>
        </wd-cell>
      </view>
      <view class="mb-20rpx rounded-20rpx">
        <wd-cell>
          <template #title>
            <view>
              <view class="inline-block mr-10rpx">诉求内容:</view>
              <view class="text-#5a5b5d">
                {{ caseData.content }}
              </view>
            </view>
          </template>
        </wd-cell>
      </view>
      <view class="mb-20rpx rounded-20rpx">
        <wd-cell>
          <template #title>
            <view>
              <view class="inline-block mr-10rpx">视频号:</view>
              <view class="inline-block text-#5a5b5d">{{ caseData.meetingNumber }}</view>
            </view>
          </template>
        </wd-cell>
      </view>
      <view class="mb-20rpx rounded-20rpx">
        <wd-cell>
          <template #title>
            <view>
              <view class="inline-block mr-10rpx">检查长名称:</view>
              <view class="inline-block text-#5a5b5d">{{ caseData.acceptUserName }}</view>
            </view>
          </template>
        </wd-cell>
      </view>
      <view class="mb-20rpx rounded-20rpx">
        <wd-cell>
          <template #title>
            <view>
              <view class="inline-block mr-10rpx">预约时间:</view>
              <view class="inline-block text-#5a5b5d">{{ caseData.requestTime }}</view>
            </view>
          </template>
        </wd-cell>
      </view>
      <view class="mb-20rpx rounded-20rpx">
        <wd-cell>
          <template #title>
            <view>
              <view class="inline-block mr-10rpx">申请状态:</view>
              <view class="inline-block text-#5a5b5d">{{ getType(caseData.status) }}</view>
            </view>
          </template>
        </wd-cell>
        <wd-cell>
          <template #title>
            <view>
              <view class="inline-block mr-10rpx">审核说明:</view>
              <view class="text-#5a5b5d">
                {{ caseData.acceptContent }}
              </view>
            </view>
          </template>
        </wd-cell>
      </view>
    </view>
  </view>
</template>
<script setup lang="ts">
import { getInterviewAPI } from '@/service/index/foo'
const active = ref<number>(0)
const typeList = [
  {
    value: 1,
    label: '审核中',
  },
  {
    value: 2,
    label: '审核通过',
  },
  {
    value: 3,
    label: '审核驳回',
  },
]
const caseData = ref({
  name: undefined,
  content: undefined,
  acceptUserName: undefined,
  requestTime: undefined,
  partyCard: undefined,
  status: undefined,
  acceptContent: undefined,
  meetingNumber: undefined,
})
const getType = computed(() => {
  return function (index) {
    if (index != undefined) {
      return typeList.filter((item) => {
        return item.value == index
      })[0].label
    }
  }
})
onLoad((options) => {
  console.log(options.id)

  if (options.id) {
    getInterviewAPI(options.id).then((res) => {
      caseData.value = Object.assign(unref(caseData), res.data)
      if (caseData.value.status == 3 || caseData.value.status == 2) {
        active.value = 2
      }
      if (caseData.value.status == 1) {
        active.value = 1
      }
    })
  }
})
</script>
<style lang="scss" scoped>
::v-deep .wd-cell__right {
  flex: none !important;
}
</style>
